
// 使用模块化语法 在 interface.js中 直接 引入request.js
import { request } from "./request.js";

export const isExistUser = params => request({
    type: "get",
    url: "http://43.138.81.225/demo/php/isExistUser.php",
    data: params,
    dataType: "json",
});

export const isExistPhone = params => request({
    type: "get",
    url: "http://43.138.81.225/demo/php/isExistPhone.php",
    data: params,
    dataType: "json",
});

export const isExistEmail = params => request({
    type: "get",
    url: "http://43.138.81.225/demo/php/isExistEmail.php",
    data: params,
    dataType: "json",
});

export const register = params => request({
    type: "post",
    url: "http://43.138.81.225/demo/php/register.php",
    data: params,
    dataType: "json",
});

export const loginAccount = params => request({
    type: "post",
    url: "http://43.138.81.225/demo/php/login_account.php",
    data: params,
    dataType: "json",
});

export const searchAllGoods = params => request({
    type: "get",
    url: "http://43.138.81.225/demo/php/searchAllGoods.php",
    data: params,
    dataType: "json",
});

export const searchGoodsOrderLimit = params => request({
    type: "get",
    url: "http://43.138.81.225/demo/php/searchGoodsOrderLimit.php",
    data: params,
    dataType: "json",
});


export const searchGoodsByGoodsId = params => request({
    type: "get",
    url: "http://43.138.81.225/demo/php/searchGoodsByGoodsId.php",
    data: params,
    dataType: "json",
});

export const addToShoppingCar = params => request({
    type: "post",
    url: "http://43.138.81.225/demo/php/addToShoppingCar.php",
    data: params,
    dataType: "json",
});

export const searchShoppingCarByUser = params => request({
    type: "post",
    url: "http://43.138.81.225/demo/php/searchShoppingCarByUser.php",
    data: params,
    dataType: "json",
});

export const updateShoppingCarById = params => request({
    type: "post",
    url: "http://43.138.81.225/demo/php/updateShoppingCarById.php",
    data: params,
    dataType: "json",
});

export const deleteShoppingCarById = params => request({
    type: "get",
    url: "http://43.138.81.225/demo/php/deleteShoppingCarById.php",
    data: params,
    dataType: "json",
});